package org.devgframwork.flowsystem.api.admin.menu.entity.vo;

import org.devgframwork.flowsystem.api.admin.menu.entity.po.Menu;
import lombok.Data;

import java.util.List;

/**
 * @Description
 * @auther dh
 * @date 2022/7/18 15:25
 */
@Data
public class MenuVo {

    private String icon;

    private String index;

    private String title;

    private List<MenuVo> subs;


    public static MenuVo getMenuVo(Menu menu,List<MenuVo> subMenuList){
        MenuVo menuVo = new MenuVo();
        menuVo.setIndex(menu.getMenuPath());
        menuVo.setTitle(menu.getMenuName());
        menuVo.setIcon(menu.getMenuIcon());
        menuVo.setSubs(subMenuList.size() <= 0 ? null : subMenuList);
        return menuVo;
    }

}
